package rjeutsky.ui;

import java.util.Scanner;

public class BooleanConsoleRequest extends ConsoleRequest<Boolean> {

	@Override
	protected void showRequest() {
		System.out.println(String.format("%1$s (y/n)", requestText));
	}
	
	@Override
	protected void queryConsole() {
		Scanner scanner = new Scanner(input);
		while (true){
			String line = scanner.nextLine();
			if (line.equalsIgnoreCase("y"))	{
				value = true;
				return;
			}
			if (line.equalsIgnoreCase("n")) {
				value = false;
				return;
			}
		}
		
	}
	
}
